<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<ui:composition template="template.xhtml">
	<ui:define name="content">
	
		<f:metadata>  
		    <f:viewParam name="elementId" value="#{excursionAvailabilityBean.excursionAvailabilityId}" />  
		    <f:viewParam name="excursionId" value="#{excursionAvailabilityBean.excursionId}" /> 
		</f:metadata>

		<h2>Modifica disponibilità escursione "<h:outputText value="#{excursionAvailabilityBean.excursion.name}" />":</h2>

		<h:form>
			<p:panelGrid columns="2">
				<f:facet name="header">  
		        	Inserisci nuovo elemento 
		    	</f:facet>
		    	
		    	<h:outputLabel value="Data inizio:" />
		    	<p:calendar value="#{excursionAvailabilityBean.excursionAvailability.fromDate}" />
		    	
		    	<h:outputLabel value="Data fine:" />
		    	<p:calendar value="#{excursionAvailabilityBean.excursionAvailability.toDate}" />
		    	
		    	<h:outputLabel value="Posti disponibili:" />  
		    	<p:inputTextarea rows="1" value="#{excursionAvailabilityBean.excursionAvailability.remaining}"></p:inputTextarea>
		    	
		    	<f:facet name="footer"> 
		    	
		    		<center>
		    			<p:button outcome="manageExcursionAvailability" value="Annulla" >
		    			<f:param name="excursionId" value="#{excursionAvailabilityBean.excursionId}" />  
		    			</p:button>
		    			<p:commandButton action="#{excursionAvailabilityBean.updateExcursionAvailability}" value="Salva" />
		    		</center>
		    	
		    	</f:facet>
			
			</p:panelGrid>
			</h:form>
			<br />
			<p:messages showDetail="true" autoUpdate="true" closable="true" />

	</ui:define>
</ui:composition>
</html>